use actix_http::Response;
use askama::Template;
use actix_web::error::UrlencodedError::ContentType;
use actix_http::body::Body;

pub mod index;

type TemplateResult = Result<Response<Body>, failure::Error>;

fn make_template_result<T: Template>(t: T) -> TemplateResult {
    let content_type = "text/html;charset=utf-8";
    Ok(Response::Ok().set_header("Content-Type", content_type).body(t.render()?))
}
